#pragma once
#include "plane.h"
#include "ICamera.h"
#include "TypeDefs.h"
#include "plane.h"
#include "matrix.h"
#include "AABoundingBox.h"
#define PLANE_TOP 0
#define PLANE_BOTTOM 1
#define PLANE_LEFT 2
#define PLANE_RIGHT 3
#define PLANE_NEAR 4
#define PLANE_FAR 5
#define PLANE_COUNT 6
#define CHECK_INSIDE 1
#define CHECK_OUTSIDE 0
#define CHECK_PARTIAL 2
class frustum
{
public:
	frustum(void);
	frustum(matrix matViewProj);
	frustum(ICamera *pCamera);
	~frustum(void);
	const plane &operator[](int index) const {
		return m_frusumPlanes[index]; };
	int CheckBox(const AABoundingBox &box) const;
	int CheckPoint(const vector3 &point) const;
private:
	void _init();
private:
	plane m_frusumPlanes[6];
	matrix m_matViewProj;
};

